//
//  Student.m
//  OCDay08homework
//
//  Created by dllo on 16/5/31.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "Student.h"

@implementation Student

-(void)compareAgeWithAnotherStudent:(Student *)anotherStudent{
    if(self.age < anotherStudent.age){
        NSLog(@"%@ 年龄比较大",anotherStudent.name);
    } else if(self.age > anotherStudent.age) {
        NSLog(@"%@ 年龄比较大",self.name);
    } else {
        NSLog(@"%@ 和 %@ 一样大",self.name,anotherStudent.name);
    }
}

-(instancetype)initWithName:(NSString *)name withAge:(NSInteger)age withNumber:(NSInteger)number withScore:(NSMutableDictionary *)score{
    self = [super init];
    if(self){
        self.name = name;
        self.age = age;
        self.number = number;
        if(score == nil){
            self.score = [NSMutableDictionary dictionary];
        } else {
            self.score = score;
        }
    }
    return self;
}

- (NSString *)description
{
    return [NSString stringWithFormat:@"姓名:%@ 年龄:%ld 学号:%ld 成绩:%@", self.name,self.age,self.number,self.score];
}



@end
